<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/css/bootstrap.min.css"/>
<title>秒杀列表页</title>
</head>
<body>
	<div class="container">
		<div class="panel panel-default">
			<div class="panel-heading text-center">
				<h2>秒杀列表</h2>
			</div>
			<div class="panel-body">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>名称</th>
							<th>库存</th>
							<th>开始时间</th>
							<th>结束时间</th>
							<th>创建时间</th>
							<th>详情页</th>
						</tr>					
					</thead>
					<tbody>
					<c:forEach var="sk" items = "${list}">
						<tr>
							<td>${sk.name }</td>
							<td>${sk.number }</td>
							<td><fmt:formatDate value="${sk.startTime }" type = "both"/></td>
							<td><fmt:formatDate value="${sk.endTime }" type = "both"/></td>
							<td><fmt:formatDate value="${sk.createTime }" type = "both"/></td>
							<td><a class = "btn btn-info" href="/seckill/${sk.seckillId}/detail" target = "blank">link</a></td>
						</tr>
					</c:forEach>
					</tbody>				
				</table>
			</div>
		</div>	
	</div>
</body>
<script src="${pageContext.request.contextPath }/static/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath }/static/js/bootstrap.min.js"></script>
</html>